package com.gzhryc.pay.adaptation.weixin.msg.normal;

import com.gzhryc.pay.adaptation.weixin.msg.GoodsDetailItem;

import java.io.Serializable;
import java.util.List;

/**
 * 微信V3版本退款请求
 */
public class WXPayNormalRefundRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    private String transaction_id;      //微信支付订单号,与out_trade_no二选一
    private String out_trade_no;        //商户订单号，与transaction_id二选一

    private String out_refund_no;       //商户退款单号,必须
    private String reason;              //退款原因
    private String notify_url;          //退款结果回调
    private String funds_account;       //退款资金来源,若传递此参数则使用对应的资金账户退款，否则默认使用未结算资金退款（仅对老资金流商户适用）枚举值：AVAILABLE：可用余额账户

    private AmountItem amount;              //金额信息，必须
    private List<GoodsDetailItem> goods_detail;      //退款商品

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getOut_refund_no() {
        return out_refund_no;
    }

    public void setOut_refund_no(String out_refund_no) {
        this.out_refund_no = out_refund_no;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getNotify_url() {
        return notify_url;
    }

    public void setNotify_url(String notify_url) {
        this.notify_url = notify_url;
    }

    public String getFunds_account() {
        return funds_account;
    }

    public void setFunds_account(String funds_account) {
        this.funds_account = funds_account;
    }

    public AmountItem getAmount() {
        return amount;
    }

    public void setAmount(AmountItem amount) {
        this.amount = amount;
    }

    public List<GoodsDetailItem> getGoods_detail() {
        return goods_detail;
    }

    public void setGoods_detail(List<GoodsDetailItem> goods_detail) {
        this.goods_detail = goods_detail;
    }

    public static class AmountItem implements Serializable {

        private static final long serialVersionUID = 1L;

        private Integer refund;     //退款金额，必须
        private List<AmountFromItem> from;  //退款需要从指定账户出资时，传递此参数指定出资金额（币种的最小单位，只能为整数）
        private Integer total;      //原订单金额
        private String currency = "CNY";    // 货币类型,CNY：人民币，境内商户号仅支持人民币

        public Integer getRefund() {
            return refund;
        }

        public void setRefund(Integer refund) {
            this.refund = refund;
        }

        public List<AmountFromItem> getFrom() {
            return from;
        }

        public void setFrom(List<AmountFromItem> from) {
            this.from = from;
        }

        public Integer getTotal() {
            return total;
        }

        public void setTotal(Integer total) {
            this.total = total;
        }

        public String getCurrency() {
            return currency;
        }

        public void setCurrency(String currency) {
            this.currency = currency;
        }
    }

    public static class AmountFromItem implements Serializable {

        private static final long serialVersionUID = 1L;

        private String account;     //出资账户类型,枚举值：AVAILABLE : 可用余额，UNAVAILABLE : 不可用余额
        private Integer amount;      //出资金额

        public String getAccount() {
            return account;
        }

        public void setAccount(String account) {
            this.account = account;
        }

        public Integer getAmount() {
            return amount;
        }

        public void setAmount(Integer amount) {
            this.amount = amount;
        }
    }
}
